package tech.aistar.mapper;

import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository;
import tech.aistar.entity.ExaInfo;

import java.util.Date;

@Repository
public interface ExaInfoMapper {
    @Select("select * from exa_info where test_id = ${tid}")
    ExaInfo findexa(String tid);

    @Insert("insert into exa_info(paper_id,test_value,test_start,test_end,test_date,us_id) value (#{paperId},#{testValue},#{testStart},#{testEnd},#{testDate},#{usId})")
    int insertExaInfo(ExaInfo exaInfo);

    @Select("select * from exa_info where paper_id = ${paperId}")
    ExaInfo findByPaperId(Long paperId);

    @Select("select test_id from exa_info where test_start = (SELECT max(test_start) FROM exa_info) and us_id =#{usId}")
    Long findByStartTime(Long usId);//根据最新的一条数据的test_start值来查


}
